

let axis = ['svgAxis', 'svgGrid', 'svgPolar', 'svgGridPoints']
let shape = ['svgCircle', 'svgRect', 'svgLines', 'svgCurves', 'svgSawtooths',
    'svgCirclesPattern', 'svgRectsPattern', 'svgGridRect', 'svgGridPolygon']
let polygon = ['svgtriangle', 'svgPolygon', 'svgPolygonColor', 'svgPolygonLink',
    'svgFerrisWheel', 'svgComplex', 'svgRay', 'svgRayCurve', 'svgIsometric', 'svgPolarShape',
    'svgSpiralShape', 'svgRingShape', 'svgRayShape', 'svgGridShape', 'svgIsometricShape', 'svgPolygonShape']
let fractal = ['svgEdgeMirror', 'svgVertexMirror', 'svgEdgeFractal', 'svgVertexFractal', 'svgEdgeMirrorLink'
    , 'svgFractalGroup', 'svgFractalFull', 'svgFractalRadio', 'svgEdgeMid', 'svgYangehui', 'svgLeaves',
    'svgTriangleLeaf', 'svgSquareFractal', 'svgSierpinskiTriangle',  'svgMitsubishi',
    'svgHexaflake', 'svgTree', 'svgPlant', 'svgDragon',  'svgOneline']
    //'svgKoch','svgPeano', 'svgGougu', 
let curve = ['svgCurve', 'svgWave', 'svgSawtooth', 'svgSemicircle', 'svgElliptical', 'svgEllipticalLink',
    'svgSin', 'svgWanhuachi']
let star = ['svgStar5', 'svgStar6', 'svgStar7', 'svgStar8', 'svgStar12']
let icon = ['svgIconPlay', 'svgIconPrev', 'svgIconPause', 'svgIconStop']
let transform = ['svgMisplaced5', 'svgMisplaced6', 'svgMisplaced7', 'svgMisplaced8', 'svgMisplaced9']
let pathpoints = ['svgPolygonPath', 'svgPolygonPath2', 'svgPolygonPath3', 'svgPolygonPath4', 'svgPolygonPath5']
let spiral = ['svgSpiral', 'svgSpiraltriangle', 'svgTwoSpiral']
let game = ['svgMaze', 'svgMaze2', 'svgMotion', 'svgLayout']
let canvasShape = ['canvasCircle', 'canvasRect', 'canvasPolygon', 'canvasPolygonMirror',
    'canvasPolygonEdgeMirror',
    'canvasPolarShape', 'canvasSpiralShape', 'canvasRingShape', 'canvasRayShape']
let webglShape = ['webgl', 'glTriangle', 'glSquare', 'glCube'] //, 'glBall'
let canvasPlant = ['canvasPlant', 'canvasBush', 'canvasAquatic', 'canvasSaupe',
    'canvasShrub', 'canvasAquaticPlant', 'canvasLsystemTree']
let canvasButterfly = ['canvasButterfly', 'canvasButterfly2', 'canvasButterfly3', 'canvasButterfly4', 'canvasButterfly5']
let lsystem = ['svgLsystemTree', 'svgLsystem_2', 'svgDragonCurve', 'svgTerdragon', 'svgAquaticPlant'
    , 'svgMosaic', 'svgBlocks', 'svgLeaf', 'svgPenroseTiling', 'svgShrub', 'svgSaupe', 'svgAquatic', 'svgBush']

let canvasStar = ['canvasStar5', 'canvasStar6', 'canvasStar7', 'canvasStar8', 'canvasStar12']
let canvasGougu = ['canvasGougu', 'canvasGougu2', 'canvasGougu3', 'canvasGougu4']
let canvasRough = ['canvasRough', 'canvasRough2']

let svgKoch = ['svgKoch', 'svgKoch2', 'svgKoch3', 'svgKoch4', 'svgKoch5', 'svgKoch6', 'svgKoch7', 'svgKoch8', 'svgKoch9', 'svgKoch10']
let svgSierpinski = ['svgSierpinski', 'svgSierpinski2', 'svgSierpinski3', 'svgSierpinski4',
    'svgSierpinski5', 'svgSierpinski6', 'svgSierpinski7', 'svgSierpinski8', 'svgSierpinski9']
let svgPeano = ['svgPeano','svgPeano2','svgPeano3']
let svgButterfly= ['svgButterfly', 'svgButterfly2', 'svgButterfly3', 'svgButterfly4', 'svgButterfly5']
let svgGougu = ['svgGougu', 'svgGougu2', 'svgGougu3', 'svgGougu4']
let items = {
    axis,
    shape,
    polygon,
    fractal,
    curve,
    star,
    icon,
    transform,
    pathpoints,
    spiral,
    game,
    canvasShape,
    webglShape,
    canvasPlant,
    canvasButterfly,
    lsystem,
    canvasStar,
    canvasGougu,
    canvasRough,
    svgKoch,
    svgSierpinski,
    svgPeano,
    svgButterfly,
    svgGougu
}

let genTitle = (name, type) => {
    let reg = new RegExp(`^${type === 'webgl' ? 'gl' : type}(.+)`)
    let str = name.replace(reg, "$1")
    return str.slice(0, 1).toLowerCase() + str.slice(1)
}
let _itemMap = (name, type) => {
    let children = items[name].map(t => {
        return {
            title: genTitle(t, type),
            name: t,
            url: t,
            contentType: type
        }

    })
    return {
        name,
        title: name,
        children
    }
}
let svg = {
    title: 'svg',
    name: 'svg',
    children: ['axis', 'shape', 'polygon', 'fractal', 'curve', 'star', 'icon',
        'transform', 'pathpoints', 'spiral', 'game', 'lsystem',
         'svgKoch', 'svgSierpinski','svgPeano','svgButterfly','svgGougu'].map(t => _itemMap(t, 'svg'))
}

let canvas = {
    title: 'canvas',
    name: 'canvas',
    children: ['canvasShape', 'canvasPlant', 'canvasButterfly',
        'canvasStar', 'canvasGougu', 'canvasRough'].map(t => _itemMap(t, 'canvas'))
}
let webgl = {
    title: 'webgl',
    name: 'webgl',
    children: ['webglShape'].map(t => _itemMap(t, 'webgl'))
}



let menu = [svg, canvas, webgl]

export default {
    menu,
    activeName: '',
    target: '.main .screen-viewer'
}